<?php
namespace app\admin\model;

use app\common\helper\Obj2Array;
use app\common\model\project_model\ButtonModel as Button;
use think\Model;

class ButtonModel extends  Button{

    /**
     * 返回所有启用的按钮用于select下拉选
     */
    public static function buttonList() {
        $model = new self();
        $list = $model->field('name, key, id')->where(['status' => self::STATUS_OK])->select();
        if (empty($list)) {
            return [];
        }
        return Obj2Array::resObject2Array($list);
    }

}